Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Ghost Text and CodeLens issue in Jetbrains #6494

Merged
merged 2 commits into from
Jan 7, 2025
Merged

Conversation

arafatkatze
Copy link
Collaborator

@arafatkatze arafatkatze commented Dec 31, 2024

Linear Issue

Thanks to @pkukielka for debugging this

Problem

Codelens would remain stuck on screen after accepting edits through the chat section's show diff feature.

Solution

Modified the LensesService to properly handle editor invalidation by:

  • Targeting the specific codelens that matches the file being updated instead of the file currently open in the editor
  • Using getAllOpenEditors() to find the correct editor context
  • Ensuring code vision providers are properly invalidated for the matching editor

Test plan

Verified that:

  • CodeLens clears properly after accepting edits through show diff
  • The behavior in this video does NOT happen anymore

Changelog

@arafatkatze
Copy link
Collaborator Author

NOTE: I don't know in general if we write/should write tests for this kind of stuff but am happy to do it.

Copy link
Contributor

@pkukielka pkukielka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pkukielka
Copy link
Contributor

NOTE: I don't know in general if we write/should write tests for this kind of stuff but am happy to do it.
In general we should, but in this specific case it was just the line which was invoking JetBrains API so it's a bit hard to test due to this calls being asynchronous...
I think we can skip it for now.

BTW. your tests are failing due to formatting, you need to run ./greadlew :spotlessApply

@arafatkatze arafatkatze enabled auto-merge (squash) January 7, 2025 14:58
@arafatkatze arafatkatze merged commit 77df8d2 into main Jan 7, 2025
20 of 22 checks passed
@arafatkatze arafatkatze deleted the ghost-text-fix branch January 7, 2025 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants